-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Region JSON Vindex #5806
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nits.
@deepthi can you also take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be nice to come up with an alternative to JSON, but I understand that is not the scope of this PR.
…ss/tree/ds-kcn19-demo Signed-off-by: Ryan Leonard <rleonard@spruce.com>
…bed76e7 Signed-off-by: Ryan Leonard <rleonard@spruce.com>
…bed76e7 Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
…mental Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
…nction." This reverts commit da1853d9a1ac0da9aec2c47884b80b8d57a53c2d. Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change is good. There's one minor nit.
go/vt/vtgate/vindexes/region_json.go
Outdated
// RegionMap is used to store mapping of country to region | ||
type RegionMap map[string]uint64 | ||
|
||
// RegionJson defines a vindex that uses a lookup table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is outdated. Looks like a copy-pasta from RegionExperimental
which should also be fixed.
For RegionJson
, I'd recommend:
RegionJson is a multi-column unique vindex. The first column is used to lookup the prefix part of the keyspace id, the second column is hashed, and the two values are combined to produce the keyspace id. RegionJson can be used for geo-partitioning because the first column can denote a region, and it will dictate the shard range for that region.
For RegionExperimental
, it should be as above except that the first column is itself the prefix of the keyspace id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sougou I've changed the RegionJson
description. Did you want me to also change the RegionExperimental
description in the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't mind, that will be great.
Signed-off-by: Ryan Leonard <rleonard@spruce.com>
Adds the
region_vindex
(asregion_json
) created for a Vitess conference demo (https://github.com/planetscale/vitess/blob/ds-kcn19-demo/go/vt/vtgate/vindexes/region_vindex.go), with modifications so it works with the latest Vitess version.